package com.uvnos4j.matilda.system.vo;

import com.uvnos4j.matilda.commons.vo.AbstractVo;
import com.uvnos4j.matilda.system.domain.SysAcl;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 权限 VO
 * <p>
 * Description: 权限 VO
 * </p>
 *
 * @author Guo.wl
 * @version v1.0.0
 * @see com.uvnos4j.matilda.system.vo
 * @since 2020-08-31 22:25:38
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class AclVo extends AbstractVo<SysAcl> {

    private String parentId = "";

    @NotBlank(message = "权限名称不能为空")
    @Length(min = 2, max = 20, message = "权限名称需要2-20个字符")
    private String name;

    @NotBlank(message = "权限英文名称不能为空")
    private String enname;

    @NotBlank(message = "权限值不能为空")
    private String value;

    @NotNull(message = "必须指定权限类型")
    @Range(min = 0, max = 3, message = "权限类型不合法")
    private Integer type;

    private String icon;

    @NotNull(message = "必须指定权限顺序")
    private Integer seq;

    @Length(max = 100, message = "权限URL需要6-100个字符")
    private String url;

    @Length(max = 200, message = "权限备注需要在200个字符以内")
    private String note;

}